#define _CRT_SECURE_NO_WARNINGS 1
typedef struct ListNode SL;
struct ListNode* detectCycle(struct ListNode* head) {
    SL* fast = head, * slow = head;
    while (fast && fast->next)
    {
        fast = fast->next->next;
        slow = slow->next;
        if (slow == fast)
        {
            SL* meet = slow, * cur = head;
            while (cur != meet)
            {
                cur = cur->next;
                meet = meet->next;
            }
            return cur;
        }
    }
    return NULL;

}